import { tableDefine } from './tableDefine';
import { Order } from './order';
import { DataContext, EntityObject } from './../utils/index';

export class MKitchenDataContext extends DataContext {
    private order: Order;

    constructor() {
        super("mKitchenDb", 2, tableDefine);

        this.order = new Order(this);
    }

    get Order() { return this.order; }
}


export class DataContextManager {
    static Current: DataContextManager = new DataContextManager();
    private mKitchenCtx: MKitchenDataContext
    constructor() { }

    get MKitchenCtx() { return this.mKitchenCtx; }

    Regist() {
        this.mKitchenCtx = new MKitchenDataContext();
        return this.mKitchenCtx.waitForOpen();
    }
}